package com.admin;

import com.admin.domain.media.MediaProperties;
import com.admin.domain.media.MediaStorage;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author Jonsy
 */
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@EnableConfigurationProperties(MediaProperties.class)
@EnableScheduling
public class Application {

    public static void main(String[] arg) {
        SpringApplication.run(Application.class);
    }

    CommandLineRunner init(MediaStorage<?> mediaStorage) {
        return (args) -> {
            // mediaStorage.deleteAll();
            mediaStorage.init();
        };
    }
}
